/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.ohyessoftware.sigc.infra.negocio;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Diego
 * 01/06/2011
 */
@Entity
@Table(name = "bairro", schema = "sigc")
public class Bairro implements Serializable {

    private static final long serialVersionUID = 1L;
    //atributos
    /******************************************************************************/
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "cod_bairro")
    private Long codBairro;
    @Column(name = "nome")
    private String nome;

    //relacoes
    /******************************************************************************/
    @OneToMany(mappedBy = "bairro", fetch = FetchType.LAZY)
    private List<Endereco> endereco;
    
    //get e set
    /******************************************************************************/
    public Long getCodBairro() {
        return codBairro;
    }

    public void setCodBairro(Long codBairro) {
        this.codBairro = codBairro;
    }

    public List<Endereco> getEndereco() {
        return endereco;
    }

    public void setEndereco(List<Endereco> endereco) {
        this.endereco = endereco;
    }

    public String getNome() {
        return nome;
    }

    public void setNome(String nome) {
        this.nome = nome;
    }
}
